import Vue from 'vue'
import Router from 'vue-router'

import User from '../pages/user.vue'
import Nullpages from '../pages/nullpage/nullpage.vue'
import GoodsCart from '../pages/goodscart/goodscart.vue'


Vue.use(Router)

export default new Router({
  routes: [
    // 路由属性名不能重复(重复又警告)，非必须，递归组件必须
    {
      name: 'default',
      path: '/',
      redirect: '/components'
    },
    {
      path: '/components',
      meta: {
        footShow: true
      },
      component: resolve => require(['../pages/components/components.vue'], resolve),
    },
      {
        path: '/components/tips',
        component: resolve => require(['../pages/components/components-pages/tips/tips.vue'], resolve),
      },
      {
        path: '/components/view',
        component: resolve => require(['../pages/components/components-pages/view/view.vue'], resolve),
      },
      {
        path: '/components/tree',
        component: resolve => require(['../pages/components/components-pages/tree/tree.vue'], resolve),
      },
      {
        path: '/components/viewImage',
        component: resolve => require(['../pages/components/components-pages/viewImage/viewImage.vue'], resolve),
      },
      {
        path: '/components/video',
        component: resolve => require(['../pages/components/components-pages/video/video.vue'], resolve),
      },
      {
        path: '/components/calendar',
        component: resolve => require(['../pages/components/components-pages/calendar/calendar.vue'], resolve),
      },
      {
        path: '/components/goodsspec',
        component: resolve => require(['../pages/components/components-pages/goodsspec/goodsspec.vue'], resolve),
      },
      {
        path: '/components/goodscart',
        component: resolve => require(['../pages/components/components-pages/goodscart/goodscart.vue'], resolve),
      },
      {
        path: '/components/viewimglist',
        component: resolve => require(['../pages/components/components-pages/viewimglist/imglist.vue'], resolve),
      },
    {
      path: '/user',
      component: User,
    },
    {
      path: '/goodscart',
      component: GoodsCart,
    },
  ],
  // mode: 'history'//去除路径中的#号
})
